<script>
function addLine(){
	var cloneLine = $("#addShareFeeCloneTr").clone();
	$("#addShareFeeTableBody").prepend(cloneLine);
}
function removeLine(ctr){
	$(ctr).parent().parent().remove();
}
</script>
<form method="post" action="admin/fee/share/add" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
<div class="pageHeader">
	<table>
		<tr>
			<td>商户：</td>
			<td>
				<input type="hidden" name="merchCode" value=""/>
				<input type="text" name="merchName" class="required" suggestFields="merchName,merchCode"  />
			</td>
			<td>
				<a class="btnLook" href="admin/merch/lookup" lookupGroup="">查找带回</a>
			</td>
		</tr>
	</table>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
				<li><a class="add" href="javascript:addLine()"><span>添加行</span></a></li>
		</ul>
	</div>
	<div id="w_list_print">
	<table class="list" style="width: 98%" targetType="navTab" asc="asc" desc="desc" layoutH="100">
		<thead>
			<tr>
				<th width="100">分润机构</th>
				<th width="100">渠道</th>
				<th width="100">支付类别</th>
				<th width="100">是否固定</th>
				<th width="100">分润费率</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody id="addShareFeeTableBody">
			
		</tbody>
	</table>
	</div>
	  <div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
</div>
</form>
		<table style="display: none">
			<tr id="addShareFeeCloneTr">
				<td>
					<input type="text" name="orgCode" class="required"/>
				</td>
				<td>
					<select name="channelCode">
	                     #for(channel : channelList)
	                          <option value="#(channel.code)">#(channel.code)#(channel.name)</option>
	                     #end
	                 </select> 
				</td>
				<td>
					<select name="payTypeCode">
	                     #for(payType : payTypeList)
	                          <option value="#(payType.code)">#(payType.code)#(payType.name)</option>
	                     #end
	                 </select> 
				</td>
				<td>
					<select name="isFixed">
	                     <option value="true">是</option>
	                 </select> 
				</td>
				<td>
					<select name="shareFeeId">
	                    #for(feeModel : feeModelList)
	                        <option value="#(feeModel.id )"#(shareFeeId == feeModel.id ? "selected" : "" )>#(feeModel.name)</option>
	                    #end
	                </select> 
				</td>
				<td>
					<a  href="javascript:;" onclick="removeLine(this)" >
	               		<i class="fa fa-times"></i>删除行
	               	</a>
				</td>
			</tr>
		</table>
